using System.Diagnostics.CodeAnalysis;
using Bookvar.ObjectModel;

namespace Bookvar.UI.ViewModel
{
    public partial class AttachmentsWindowViewModel : TopicViewModelBase
    {
        private readonly MindMap mindmap;
        private Attachment selectedAttachment;

        #region Properties

        [SuppressMessage( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )]
        public Attachment SelectedAttachment
        {
            get { return selectedAttachment; }
            set { SetFieldValue( "SelectedAttachment", ref selectedAttachment, value ); }
        }

        public MindMap Mindmap
        {
            get { return mindmap; }
        }

        #endregion

        public AttachmentsWindowViewModel( MindMap mindmap, Topic topic ) : base( topic )
        {
            this.mindmap = mindmap;
        }

        protected override void InitializeCommands()
        {
            base.InitializeCommands();

            Commands.Add( new AddAttachmentCommand( this ) );
            Commands.Add( new SaveAttachmentCommand( this ) );
            Commands.Add( new DeleteAttachmentCommand( this ) );
        }
    }
}